#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 25;

int n, m;
int a[N][N];
int ans;
int dx[] = {-2, -1, 1, 2}, dy[] = {1, 2, 2, 1};
void dfs(int x, int y) {
  if (x == n && y == m) {
    ans++;
    return;
  }
  if (x < 0 || x > n || y < 0 || y > m) return;
  rep(i, 0, 3) {
    int xx = x + dx[i], yy = y + dy[i];
    dfs(xx, yy);
  }
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> m;
  dfs(0, 0);
  cout << ans;
  return 0;
}